package com.beaglebros.SDWatch;

class Prefs {
	
	private static Bitmask ids = new Bitmask();
	
	public Prefs() {
	}
	
	public int getId() throws BitmapOutOfBoundsException {
		for (int i=0; ;i++) {
			if (!ids.getBit(i)) {
				ids.setBit(i);
				return i;
			}
		}
	}
	
	public void freeId(int id) throws BitmapOutOfBoundsException {
		ids.clearBit(id);
	}
	
}
